const http = uni.$u.http;

// 地址列表
export const getAddressList = (params, config = {custom: {auth: true}}) => http.post('/api/address/lists', params, config)

//地址详情
export const getAddressDetail = (params, config = {custom: {auth: true}}) => http.post('/api/address/detail',params,config)

export const delAddress = (params, config = {custom: {auth: true}}) => http.delete('/api/address/del', params, config)

export const addAddress = (params, config = {custom: {auth: true}}) => http.post('/api/address/add', params, config)

export const editAddress = (params, config = {custom: {auth: true}}) => http.put('/api/address/edit', params, config)



//文章列表
export const getList = () => http.get('/api/article/lists')

//文章详情
export const getDetail = (params,config = {}) => http.post('/api/article/detail', params, config)



// 商品列表
export const getGoodsList = () => http.get('/api/goods/lists')

//商品详情
export const getGoodsDetail = (params, config = {}) => http.post('/api/goods/detail', params, config)



//购物车
export const getCart = (params, config = {}) => http.post('/api/cart/index', params, config)

export const checkOrder = (params, config = {custom: {auth: true}}) => http.post('/api/order/check', params, config)

export const sendOrder = (params, config = {custom: {auth: true}})=> http.post('/api/order/send', params, config)

export const payOrder = (params, config = {custom: {auth: true}})=> http.post('/api/order/detail', params, config)

export const getOrderDetail = (params, config = {custom: {auth: true}})=> http.post('/api/order/detail', params, config)

export const apiOrderList = (params, config = {custom: {auth: true}})=> http.post('/api/order/lists', params, config)
//首页数据
export const getHome = () => http.get('/api/index/home')

//登录
export const apiLogin = (params, config = {}) => http.post('/api/login/login', params, config)

//register 
export const register = (params, config = {}) => http.post('/api/index/register', params, config)




